﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Ozone.Views.Widget
{
    /// <summary>
    /// UCLabel1.xaml 的交互逻辑
    /// </summary>
    public partial class UCLabel1 : UserControl
    {
        public UCLabel1()
        {
            InitializeComponent();
        }

        public void setVal(string val)
        {
            lblContent.Content = val;
        }

        public string getVal()
        {
            return lblContent.Content.ToString();
        }

     

        public string Text
        {
            get { return lblContent.Content.ToString(); }
            set { lblContent.Content = value;  }
        }


   
        public string TextT
        {
            get { return (string)GetValue(TextTProperty); }
            set { SetValue(TextTProperty, value); }
        }

        // 当外部绑定后,数据变化时,属性会变化,但是界面不会更新
        //public static readonly DependencyProperty TextTProperty =
        //    DependencyProperty.Register("TextT", typeof(string ), typeof(UserControl1), new PropertyMetadata(null));

        // 当外部绑定后,数据变化时,界面更新
        public static readonly DependencyProperty TextTProperty =
            DependencyProperty.Register("TextT", typeof(string), typeof(UCLabel1), new PropertyMetadata(null, (s, e) =>
            {
                ((UCLabel1)s).TextT = (string)e.NewValue;
            }));



    }
}
